package com.company;

import java.util.Scanner;

public class ChangeMaker
{
    public static void main(String[] args)
    {
        int amount;                 //数量
        int originalAmount;         //初始数量
        int quarters;               //25美分
        int dimes;                  //10美分
        int nickels;                //5美分
        int pennies;                //1美分

        System.out.println("Enter a whole number from 1 to 99.");               //输入一个整数
        System.out.println("I will find a combination of coins");               //我会找到硬币的组合
        System.out.println("that equals that amount of change.");                  //平分这些零钱

        Scanner keyboard = new Scanner(System.in);                                  //创造一个容器从键盘中获取数据
        amount = keyboard.nextInt( );                                               //接收一个整数

        originalAmount = amount;
        quarters = amount / 25;
        amount = amount % 25;
        dimes = amount / 10;
        amount = amount % 10;
        nickels = amount / 5;
        amount = amount % 5;
        pennies = amount;                                                           //分配过程

        System.out.println(originalAmount +
                " cents in coins can be given as:");
        System.out.println(quarters + " quarters");
        System.out.println(dimes + " dimes");
        System.out.println(nickels + " nickels and");
        System.out.println(pennies + " pennies");                                   //输出
    }
}
